#ifndef PMR_H_
#define PMR_H_

#include "recbase.h"
#include "rectype.h"
#include "stdffield.h"

namespace opsrc {
    namespace stdf {

        class Pmr : public opsrc::stdf::RecBase
        {
        public:
            Pmr(stdf_rec stdfrec,  int reclen, std::ios::pos_type fileRecFirstBytePosition, int orderindex, endian e, char* buf);
            virtual ~Pmr();

            void setUniquePinIndex(StdfField<int> pmrindx);
            const StdfField<int> getUniquePinIndex() const;

            void setChannelType(StdfField<int> chantyp);
            const StdfField<int> getChannelType() const;

            void setChannelName(StdfField<string> channam);
            const StdfField<string> getChannelName() const;

            void setPhysicalPinName(StdfField<string> phynam);
            const StdfField<string> getPhysicalPinName() const;

            void setLogicalPinName(StdfField<string> lognam);
            const StdfField<string> getLogicalPinName() const;

            const StdfField<int> getHeadNum() const;
            void setHeadNum(StdfField<int> headnum);

            const StdfField<int> getSiteNum() const;
            void setSiteNum(StdfField<int> sitenum);

            void readFields(char *buf);

        protected:
            Pmr();

        private:
            StdfField<int> pmr_indx;
            StdfField<int> chan_typ;
            StdfField<string> chan_nam;
            StdfField<string> phy_nam;
            StdfField<string> log_nam;
            StdfField<int> head_num;
            StdfField<int> site_num;

            endian en;
            bool decodeFields;
            /*
PMR_INDX U*2 Unique index associated with pin
CHAN_TYP U*2 Channel type 0
CHAN_NAM C*n Channel name length byte = 0
PHY_NAM C*n Physical name of pin length byte = 0
LOG_NAM C*n Logical name of pin length byte = 0
HEAD_NUM U*1 Head number associated with channel 1
SITE_NUM U*1 Site number associated with channel 1
*/			
        };

    }	// namespace stdf
}		// namespace opsrc

#endif /*PMR_H_*/
